﻿using Commonality;
using ICarlifeRespository;
using ICarlifeService;
using Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static Commonality.Examineandapprove;

namespace CarlifeService
{
    public class CarLeaseProjectService : BaseServer<CarLeaseProject>, ICarLeaseProjectService
    {
        private readonly ICarLeaseProjectRespository db;
        private readonly IUOfWork uOfWork;
        public CarLeaseProjectService(ICarLeaseProjectRespository db, IUOfWork uOfWork) : base(db, uOfWork)
        {
            this.db = db;
            this.uOfWork = uOfWork;
        }

        public async Task<List<CarLeaseProject>> Show()
        {
            var sql = "select * from CarLeaseProject";
            var list = await db.Query(sql);
            return list;
        
        }

        public Task<int> Updateps(CarLeaseProject carLeaseProject)
        {
            var sql = $"Update  CarLeaseProject set Checked=@Checked where Id=@Id ";
            var a = db.Execute(sql, carLeaseProject);
            return a;
        }
    }
}
